<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/10/26
  Time: 12:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<title>资源添加</title>
<body>
<%--<div class="container">
    <div class="row">
        <div class="col-sm-12">
            <form action="${ctx}/resource/add" method="post">
                <div class="form-group">
                    <label for="app" class="col-sm-2 control-label">所属应用</label>
                    <div class="col-sm-10">
                        <select class="form-control m-b" id="app" name="app">
                            <option value="0">
                               后台管理
                            </option>
                        </select>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label for="resourcePid" class="col-sm-2 control-label">上级菜单</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="resourcePid" name="resourcePid" onclick="showResources()">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label for="resourceType" class="col-sm-2 control-label">资源类型</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="resourceType" name="resourceType">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label for="resourceName" class="col-sm-2 control-label">资源名称</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="resourceName" name="resourceName">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label for="resourceCode" c class="col-sm-2 control-label">权限标识</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="resourceCode" name="resourceCode">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label for="resourceUrl" class="col-sm-2 control-label">URL</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="resourceUrl" name="resourceUrl">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label for="sort" class="col-sm-2 control-label">排序</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="sort" name="sort">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label for="resourceDesc" class="col-sm-2 control-label">资源描述</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="resourceDesc" name="resourceDesc">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="col-sm-2 control-label2" style="text-align: center">
                    <button type="submit" class="btn btn-primary btn-sm waves-effect waves-light">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>--%>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <form class="form-horizontal" action="${ctx}/resource/add" method="post">
                    <div class="form-group">
                        <label for="app" class="col-sm-2 control-label">所属应用</label>
                        <div class="col-sm-10">
                            <select class="form-control m-b" id="app" name="app">
                                <option value="0">
                                    后台管理
                                </option>
                            </select>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label for="resourcePid" class="col-sm-2 control-label">上级菜单</label>
                        <div class="col-sm-10">
                            <input type="hidden" class="form-control" id="resourcePid" name="resourcePid">
                            <input type="text" class="form-control" id="resourcePName" onclick="showResources()">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label for="resourceType" class="col-sm-2 control-label">资源类型</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="resourceType" name="resourceType">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label for="resourceName" class="col-sm-2 control-label">资源名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="resourceName" name="resourceName">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label for="resourceCode" c class="col-sm-2 control-label">权限标识</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="resourceCode" name="resourceCode">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label for="resourceUrl" class="col-sm-2 control-label">URL</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="resourceUrl" name="resourceUrl">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label for="sort" class="col-sm-2 control-label">排序</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="sort" name="sort">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label for="resourceDesc" class="col-sm-2 control-label">资源描述</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="resourceDesc" name="resourceDesc">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group" style="text-align: center">
                        <button type="submit" class="btn btn-primary btn-sm waves-effect waves-light">提交</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</div>
<script type="text/javascript">
    function showResources() {
        Dialog.openUrl("资源树","${ctx}/resource/tree",{
            area:['50%','70%'],
            end:function () {
            }
        })
    }

    //回显上级资源
    function getParentResource(node) {
        $("#resourcePid").val(node.id);
        $("#resourcePName").val(node.resourceName);
    }
</script>
</body>

